From 5c526c9926f56a4aabbfebac8177883dbae8985a Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sun, 23 Oct 2016 17:13:14 +0200 Subject: [PATCH] gtkplacessidebar: Remove deprecated "show-connect-to-server" --- docs/reference/gtk/gtk4-sections.txt | 2 - gtk/gtkplacessidebar.c | 116 --------------------------- gtk/gtkplacessidebar.h | 5 -- 3 files changed, 123 deletions(-) diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index e8531431e9..36a9a913e7 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -2267,8 +2267,6 @@ gtk_places_sidebar_add_shortcut gtk_places_sidebar_remove_shortcut gtk_places_sidebar_list_shortcuts gtk_places_sidebar_get_nth_bookmark -gtk_places_sidebar_get_show_connect_to_server -gtk_places_sidebar_set_show_connect_to_server gtk_places_sidebar_get_local_only gtk_places_sidebar_set_local_only gtk_places_sidebar_get_show_enter_location diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index a66d4c6c42..4ab7778be5 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -171,7 +171,6 @@ struct _GtkPlacesSidebar { guint show_recent : 1; guint show_desktop_set : 1; guint show_desktop : 1; - guint show_connect_to_server : 1; guint show_enter_location : 1; guint show_other_locations : 1; guint show_trash : 1; @@ -192,7 +191,6 @@ struct _GtkPlacesSidebarClass { void (* show_error_message) (GtkPlacesSidebar *sidebar, const gchar *primary, const gchar *secondary); - void (* show_connect_to_server) (GtkPlacesSidebar *sidebar); GdkDragAction (* drag_action_requested) (GtkPlacesSidebar *sidebar, GdkDragContext *context, GFile *dest_file, @@ -220,7 +218,6 @@ enum { OPEN_LOCATION, POPULATE_POPUP, SHOW_ERROR_MESSAGE, - SHOW_CONNECT_TO_SERVER, SHOW_ENTER_LOCATION, DRAG_ACTION_REQUESTED, DRAG_ACTION_ASK, @@ -237,7 +234,6 @@ enum { PROP_OPEN_FLAGS, PROP_SHOW_RECENT, PROP_SHOW_DESKTOP, - PROP_SHOW_CONNECT_TO_SERVER, PROP_SHOW_ENTER_LOCATION, PROP_SHOW_TRASH, PROP_LOCAL_ONLY, @@ -333,12 +329,6 @@ emit_show_error_message (GtkPlacesSidebar *sidebar, primary, secondary); } -static void -emit_show_connect_to_server (GtkPlacesSidebar *sidebar) -{ - g_signal_emit (sidebar, places_sidebar_signals[SHOW_CONNECT_TO_SERVER], 0); -} - static void emit_show_enter_location (GtkPlacesSidebar *sidebar) { @@ -1287,17 +1277,6 @@ update_places (GtkPlacesSidebar *sidebar) /* network */ if (!sidebar->local_only) { - if (sidebar->show_connect_to_server) - { - icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_NETWORK_SERVER); - add_place (sidebar, PLACES_CONNECT_TO_SERVER, - SECTION_MOUNTS, - _("Connect to Server"), icon, NULL, - NULL, NULL, NULL, 0, - _("Connect to a network server address")); - g_object_unref (icon); - } - network_volumes = g_list_reverse (network_volumes); for (l = network_volumes; l != NULL; l = l->next) { @@ -2348,10 +2327,6 @@ open_row (GtkSidebarRow *row, { open_uri (sidebar, uri, open_flags); } - else if (place_type == PLACES_CONNECT_TO_SERVER) - { - emit_show_connect_to_server (sidebar); - } else if (place_type == PLACES_ENTER_LOCATION) { emit_show_enter_location (sidebar); @@ -3932,12 +3907,6 @@ gtk_places_sidebar_set_property (GObject *obj, gtk_places_sidebar_set_show_desktop (sidebar, g_value_get_boolean (value)); break; - case PROP_SHOW_CONNECT_TO_SERVER: -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_places_sidebar_set_show_connect_to_server (sidebar, g_value_get_boolean (value)); -G_GNUC_END_IGNORE_DEPRECATIONS - break; - case PROP_SHOW_ENTER_LOCATION: gtk_places_sidebar_set_show_enter_location (sidebar, g_value_get_boolean (value)); break; @@ -3994,12 +3963,6 @@ gtk_places_sidebar_get_property (GObject *obj, g_value_set_boolean (value, gtk_places_sidebar_get_show_desktop (sidebar)); break; - case PROP_SHOW_CONNECT_TO_SERVER: -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - g_value_set_boolean (value, gtk_places_sidebar_get_show_connect_to_server (sidebar)); -G_GNUC_END_IGNORE_DEPRECATIONS - break; - case PROP_SHOW_ENTER_LOCATION: g_value_set_boolean (value, gtk_places_sidebar_get_show_enter_location (sidebar)); break; @@ -4223,28 +4186,6 @@ gtk_places_sidebar_class_init (GtkPlacesSidebarClass *class) G_TYPE_STRING, G_TYPE_STRING); - /** - * GtkPlacesSidebar::show-connect-to-server: - * @sidebar: the object which received the signal. - * - * The places sidebar emits this signal when it needs the calling - * application to present an way to connect directly to a network server. - * For example, the application may bring up a dialog box asking for - * a URL like "sftp://ftp.example.com". It is up to the application to create - * the corresponding mount by using, for example, g_file_mount_enclosing_volume(). - * - * Deprecated: 3.18: use the #GtkPlacesSidebar::show-other-locations signal - * to connect to network servers. - */ - places_sidebar_signals [SHOW_CONNECT_TO_SERVER] = - g_signal_new (I_("show-connect-to-server"), - G_OBJECT_CLASS_TYPE (gobject_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GtkPlacesSidebarClass, show_connect_to_server), - NULL, NULL, - NULL, - G_TYPE_NONE, 0); - /** * GtkPlacesSidebar::show-enter-location: * @sidebar: the object which received the signal. @@ -4471,12 +4412,6 @@ gtk_places_sidebar_class_init (GtkPlacesSidebarClass *class) P_("Whether the sidebar includes a builtin shortcut to the Desktop folder"), TRUE, G_PARAM_READWRITE); - properties[PROP_SHOW_CONNECT_TO_SERVER] = - g_param_spec_boolean ("show-connect-to-server", - P_("Show 'Connect to Server'"), - P_("Whether the sidebar includes a builtin shortcut to a 'Connect to server' dialog"), - FALSE, - G_PARAM_READWRITE | G_PARAM_DEPRECATED); properties[PROP_SHOW_ENTER_LOCATION] = g_param_spec_boolean ("show-enter-location", P_("Show 'Enter Location'"), @@ -4813,57 +4748,6 @@ gtk_places_sidebar_get_show_desktop (GtkPlacesSidebar *sidebar) return sidebar->show_desktop; } -/** - * gtk_places_sidebar_set_show_connect_to_server: - * @sidebar: a places sidebar - * @show_connect_to_server: whether to show an item for the Connect to Server command - * - * Sets whether the @sidebar should show an item for connecting to a network server; - * this is off by default. An application may want to turn this on if it implements - * a way for the user to connect to network servers directly. - * - * If you enable this, you should connect to the - * #GtkPlacesSidebar::show-connect-to-server signal. - * - * Since: 3.10 - * - * Deprecated: 3.18: It is recommended to group this functionality with the drives - * and network location under the new 'Other Location' item - */ -void -gtk_places_sidebar_set_show_connect_to_server (GtkPlacesSidebar *sidebar, - gboolean show_connect_to_server) -{ - g_return_if_fail (GTK_IS_PLACES_SIDEBAR (sidebar)); - - show_connect_to_server = !!show_connect_to_server; - if (sidebar->show_connect_to_server != show_connect_to_server) - { - sidebar->show_connect_to_server = show_connect_to_server; - update_places (sidebar); - g_object_notify_by_pspec (G_OBJECT (sidebar), properties[PROP_SHOW_CONNECT_TO_SERVER]); - } -} - -/** - * gtk_places_sidebar_get_show_connect_to_server: - * @sidebar: a places sidebar - * - * Returns the value previously set with gtk_places_sidebar_set_show_connect_to_server() - * - * Returns: %TRUE if the sidebar will display a “Connect to Server” item. - * - * Deprecated: 3.18: It is recommended to group this functionality with the drives - * and network location under the new 'Other Location' item - */ -gboolean -gtk_places_sidebar_get_show_connect_to_server (GtkPlacesSidebar *sidebar) -{ - g_return_val_if_fail (GTK_IS_PLACES_SIDEBAR (sidebar), FALSE); - - return sidebar->show_connect_to_server; -} - /** * gtk_places_sidebar_set_show_enter_location: * @sidebar: a places sidebar diff --git a/gtk/gtkplacessidebar.h b/gtk/gtkplacessidebar.h index 80f2df4a34..482cad891b 100644 --- a/gtk/gtkplacessidebar.h +++ b/gtk/gtkplacessidebar.h @@ -104,11 +104,6 @@ GDK_AVAILABLE_IN_3_10 void gtk_places_sidebar_set_show_desktop (GtkPlacesSidebar *sidebar, gboolean show_desktop); -GDK_DEPRECATED_IN_3_18 -gboolean gtk_places_sidebar_get_show_connect_to_server (GtkPlacesSidebar *sidebar); -GDK_DEPRECATED_IN_3_18 -void gtk_places_sidebar_set_show_connect_to_server (GtkPlacesSidebar *sidebar, - gboolean show_connect_to_server); GDK_AVAILABLE_IN_3_14 gboolean gtk_places_sidebar_get_show_enter_location (GtkPlacesSidebar *sidebar); GDK_AVAILABLE_IN_3_14 -- 2.30.2